#coding=utf-8
import datetime

'''
2105825891 --> 04110935
'''
data = [611, 616, 621, 626, 631, 640, 645, 650, 655, 660, 665, 670, 675,
        680, 685, 690, 695, 704, 709, 714, 719, 724, 729, 734, 837, 842,
        847, 852, 857, 862, 867, 872, 877, 882, 887, 896, 901, 906, 911,
        916, 921, 926, 931, 936, 941, 946, 951, 960]
        
def n2datetime(n):
    n1 = 1028235
    d1 = datetime.date(2008, 4,11)
    delta = datetime.timedelta(n1 - n/2048)
    #print delta
    date = d1 - delta
    
    dt1 = datetime.datetime(date.year, date.month, date.day, 9 ,35)
    dt2 = datetime.datetime(date.year, date.month, date.day, 13 ,5)
    
    d = n%2048
    i = data.index(d)
    #print i
    if i < 24:
        return dt1 + datetime.timedelta(minutes=i*5)
    else:
        i = i-24
        return dt2 + datetime.timedelta(minutes=i*5)
